package it.polimi.jita.cp;


import it.polimi.jita.cp.block.Block;
import it.polimi.jita.cp.block.BlockRegister;
import it.polimi.jita.cp.block.CliParser;
import it.polimi.jita.cp.block.Input;

/**
 * 
 * @author Federico Monterisi
 *
 */

public class App {

	public static void main(String[] args) throws Exception {
		
		CliParser parser = new CliParser();
		BlockRegister blockRegister = new BlockRegister();

		Input input = parser.parse(args);

		Block<?, ?> block = blockRegister.getBlock(input.getClass());
		block.setInput(input);
		block.getOutput();

		if (input.isNeedToSaveCSVFiles())
			block.printCSVFiles();

		if (input.isNeedToSaveCharts())
			block.saveCharts();

		if (input.isNeedToShowCharts())
			block.showCharts();

	}
}
